\hypertarget{classsc2_1_1_action_interface}{}\section{sc2\+:\+:Action\+Interface Class Reference}
\label{classsc2_1_1_action_interface}\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}


{\ttfamily \#include $<$sc2\+\_\+interfaces.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_add138c6ebe9b1fcbeae393c03b7fdeb9}{Unit\+Command} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$unit, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, bool queued\+\_\+command=false)=0
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_a7387d718d7d87c69b8476ca0d8a9f86a}{Unit\+Command} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$unit, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&point, bool queued\+\_\+command=false)=0
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_a63a3bb86851927cc58821afb0d21e1ab}{Unit\+Command} (const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$unit, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$target, bool queued\+\_\+command=false)=0
\item 
\mbox{\Hypertarget{classsc2_1_1_action_interface_aa647e739696bc228f44f7e1224d21733}\label{classsc2_1_1_action_interface_aa647e739696bc228f44f7e1224d21733}} 
virtual void \hyperlink{classsc2_1_1_action_interface_aa647e739696bc228f44f7e1224d21733}{Unit\+Command} (const Units \&units, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, bool queued\+\_\+move=false)=0
\begin{DoxyCompactList}\small\item\em Issues a command to multiple units (prefer this where possible). Same as Unit\+Command(\+Unit, Ability\+I\+D). \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_action_interface_aeea8f2ca32bfe3ee1835bddb9d1356f1}\label{classsc2_1_1_action_interface_aeea8f2ca32bfe3ee1835bddb9d1356f1}} 
virtual void \hyperlink{classsc2_1_1_action_interface_aeea8f2ca32bfe3ee1835bddb9d1356f1}{Unit\+Command} (const Units \&units, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&point, bool queued\+\_\+command=false)=0
\begin{DoxyCompactList}\small\item\em Issues a command to multiple units (prefer this where possible). Same as Unit\+Command(\+Unit, Ability\+I\+D, Point2\+D). \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_action_interface_a4999034a61ca0ebb95b722af8e305a21}\label{classsc2_1_1_action_interface_a4999034a61ca0ebb95b722af8e305a21}} 
virtual void \hyperlink{classsc2_1_1_action_interface_a4999034a61ca0ebb95b722af8e305a21}{Unit\+Command} (const Units \&units, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability, const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$target, bool queued\+\_\+command=false)=0
\begin{DoxyCompactList}\small\item\em Issues a command to multiple units (prefer this where possible). Same as Unit\+Command(\+Unit, Ability\+I\+D, Unit). \end{DoxyCompactList}\item 
virtual const std\+::vector$<$ Tag $>$ \& \hyperlink{classsc2_1_1_action_interface_a29a55f8dd4f9230864caa1deb228ae33}{Commands} () const =0
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_a5f66f9b7eaf1d6a681694927b8605004}{Toggle\+Autocast} (Tag unit\+\_\+tag, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability)=0
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_ab3990c306215b3cb8d5e62533f72db62}{Toggle\+Autocast} (const std\+::vector$<$ Tag $>$ \&unit\+\_\+tags, \hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID} ability)=0
\item 
virtual void \hyperlink{classsc2_1_1_action_interface_af054d2a35e7eb740109f63011090ea50}{Send\+Actions} ()=0
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \hyperlink{classsc2_1_1_action_interface}{Action\+Interface} issues actions to units in a game. Not available in replays. Guaranteed to be valid when the On\+Step event is called. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classsc2_1_1_action_interface_a29a55f8dd4f9230864caa1deb228ae33}\label{classsc2_1_1_action_interface_a29a55f8dd4f9230864caa1deb228ae33}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Commands@{Commands}}
\index{Commands@{Commands}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Commands()}{Commands()}}
{\footnotesize\ttfamily virtual const std\+::vector$<$Tag$>$\& sc2\+::\+Action\+Interface\+::\+Commands (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}

Returns a list of unit tags that have sent commands out in the last call to Send\+Actions. This will be used to determine if a unit actually has a command when the observation is received. \begin{DoxyReturn}{Returns}
Array of units that have sent commands. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_action_interface_af054d2a35e7eb740109f63011090ea50}\label{classsc2_1_1_action_interface_af054d2a35e7eb740109f63011090ea50}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Send\+Actions@{Send\+Actions}}
\index{Send\+Actions@{Send\+Actions}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Send\+Actions()}{SendActions()}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Send\+Actions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

This function sends out all batched unit commands. You DO N\+OT need to call this function in non real time simulations since it is automatically called when stepping the simulation forward. You only need to call this function in a real time simulation. For example, if you wanted to move 20 marines to some position on the map you\textquotesingle{}d want to batch all of those unit commands and send them at once. \mbox{\Hypertarget{classsc2_1_1_action_interface_a5f66f9b7eaf1d6a681694927b8605004}\label{classsc2_1_1_action_interface_a5f66f9b7eaf1d6a681694927b8605004}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Toggle\+Autocast@{Toggle\+Autocast}}
\index{Toggle\+Autocast@{Toggle\+Autocast}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Toggle\+Autocast()}{ToggleAutocast()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Toggle\+Autocast (\begin{DoxyParamCaption}\item[{Tag}]{unit\+\_\+tag,  }\item[{\hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID}}]{ability }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Enables or disables autocast of an ability on a unit. 
\begin{DoxyParams}{Parameters}
{\em unit\+\_\+tag} & The unit to toggle the ability on. \\
\hline
{\em ability} & The ability to be toggled. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_action_interface_ab3990c306215b3cb8d5e62533f72db62}\label{classsc2_1_1_action_interface_ab3990c306215b3cb8d5e62533f72db62}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Toggle\+Autocast@{Toggle\+Autocast}}
\index{Toggle\+Autocast@{Toggle\+Autocast}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Toggle\+Autocast()}{ToggleAutocast()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Toggle\+Autocast (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tag $>$ \&}]{unit\+\_\+tags,  }\item[{\hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID}}]{ability }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Enables or disables autocast of an ability on a list of units. 
\begin{DoxyParams}{Parameters}
{\em unit\+\_\+tags} & The units to toggle the ability on. \\
\hline
{\em ability} & The ability to be toggled. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_action_interface_add138c6ebe9b1fcbeae393c03b7fdeb9}\label{classsc2_1_1_action_interface_add138c6ebe9b1fcbeae393c03b7fdeb9}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Unit\+Command@{Unit\+Command}}
\index{Unit\+Command@{Unit\+Command}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Unit\+Command()}{UnitCommand()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Unit\+Command (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{unit,  }\item[{\hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID}}]{ability,  }\item[{bool}]{queued\+\_\+command = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Issues a command to a unit. Self targeting. 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit to send the command to. \\
\hline
{\em ability} & The ability id of the command. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_action_interface_a7387d718d7d87c69b8476ca0d8a9f86a}\label{classsc2_1_1_action_interface_a7387d718d7d87c69b8476ca0d8a9f86a}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Unit\+Command@{Unit\+Command}}
\index{Unit\+Command@{Unit\+Command}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Unit\+Command()}{UnitCommand()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Unit\+Command (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{unit,  }\item[{\hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID}}]{ability,  }\item[{const \hyperlink{structsc2_1_1_point2_d}{Point2D} \&}]{point,  }\item[{bool}]{queued\+\_\+command = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Issues a command to a unit. Targets a point. 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit to send the command to. \\
\hline
{\em ability} & The ability id of the command. \\
\hline
{\em point} & The 2D world position to target. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{classsc2_1_1_action_interface_a63a3bb86851927cc58821afb0d21e1ab}\label{classsc2_1_1_action_interface_a63a3bb86851927cc58821afb0d21e1ab}} 
\index{sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}!Unit\+Command@{Unit\+Command}}
\index{Unit\+Command@{Unit\+Command}!sc2\+::\+Action\+Interface@{sc2\+::\+Action\+Interface}}
\subsubsection{\texorpdfstring{Unit\+Command()}{UnitCommand()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily virtual void sc2\+::\+Action\+Interface\+::\+Unit\+Command (\begin{DoxyParamCaption}\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{unit,  }\item[{\hyperlink{classsc2_1_1_s_c2_type}{Ability\+ID}}]{ability,  }\item[{const \hyperlink{classsc2_1_1_unit}{Unit} $\ast$}]{target,  }\item[{bool}]{queued\+\_\+command = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}

Issues a command to a unit. Targets another unit. 
\begin{DoxyParams}{Parameters}
{\em unit} & The unit to send the command to. \\
\hline
{\em ability} & The ability id of the command. \\
\hline
{\em target} & The unit that is a target of the unit getting the command. \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/sc2api/\hyperlink{sc2__interfaces_8h}{sc2\+\_\+interfaces.\+h}\end{DoxyCompactItemize}
